"""
测试文件
"""
from CO2DA.UserException import NotNumError
from CO2DA.DataAnalyse import DataAnalyse
from CO2DA.DataVisualization import DataVisualization

PATH_pre = "Resource/Province sectoral CO2 emissions {}.xlsx"

da = DataAnalyse()
for year in range(1997,2015):
    da.load_data(year, PATH_pre.format(year))

dv = DataVisualization(da)

try:
    dv.sa_display(2000, 'Raw Coal', industry='Total Consumption', province=['Ningxia'], plot_type="pie")
except ZeroDivisionError as z:
    print(z.args)